/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.insa.flopenshop;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Locale;

/**
 *
 * @author strokyl
 */
public class RunHeuristiqueGloutonne {
	public static String RESULT_FILE_PATH = "result/heuristique_gloutonne.csv";
	public static void main(String args[]) throws FileNotFoundException {
		PrintStream ps = new PrintStream(new File(RESULT_FILE_PATH));
		long time;
		ps.println("file name, solution time, computation time in ms");
		for(Instance i : Instance.getAllInstances()) {
			time = System.nanoTime();
			Solution solution = (new HeuristiqueGloutonne(false)).solve(i);
			time = System.nanoTime() -  time;
			ps.println(String.format(Locale.US, "%s,%d,%e", i.getFileName(), solution.getTotalTime(), time/1e6));
		}

		ps.close();

	}	
}
